import React, { useContext } from 'react'
import './index.css'
import Item from '../Item/index2'
import { Context } from '../../App'

function List(props){
    const {todos,dispatch} = useContext(Context)
    return(
        <ul className="todo-main">
            {
                todos.map(todo => <Item key={todo.id} {...todo} dispatch={dispatch}/>)
            }
        </ul>
    )
}

export default List